#include <iostream>

using namespace std;

int main() {
    //定义ISBN
    char a, b, c, d, e, f, g, h, i,j;
    scanf("%c-%c%c%c-%c%c%c%c%c-%c", &a, &b, &c, &d, &e, &f, &g, &h, &i,&j);
    int check = (a - '0') * 1 + (b - '0') * 2 + (c - '0') * 3 + (d - '0') * 4 + (e - '0') * 5 + (f - '0') * 6 +
                (g - '0') * 7 + (h - '0') * 8 + (i - '0') * 9 ;
    int idNum=check%11;//识别码
    //识别
    if (j=='X' && idNum==10 || idNum==j-'0'){
        printf("Right");
    }else{
        printf("error");
    }

    return 0;
}
